//
//  BreakPointDownload.h
//  Duandianxiazai
//
//  Created by qianfeng on 15/10/16.
//  Copyright (c) 2015年 Lskang. All rights reserved.
//

#import <Foundation/Foundation.h>
//前向引用声明
@class BreakPointDownload;

typedef void(^downloadBlock)(BreakPointDownload * download);

//专门 封装一个类用于断点下载

@interface BreakPointDownload : NSObject<NSURLConnectionDataDelegate,NSCoding>

//已经下载的大小
@property (nonatomic,strong) NSFileHandle *fileHandle;
@property (nonatomic,strong)NSURLConnection *connection;


@property (nonatomic,copy) NSString *needDownLoadUrl;
@property (nonatomic,assign) unsigned long long loadedSize;
@property (nonatomic,assign) unsigned long long fileSize;
@property (nonatomic,copy) downloadBlock myBlock;

//进行断点下载 请求
//下载过程中 进行回调block
- (void)breakPointDownLoadDataWithUrl:(NSString *)url downloadProcess:(downloadBlock)myBlock;

//手动停止下载
- (void)stopDownload;

@end
